package a.e.a;

import a.i.n;
import org.xml.sax.*;

import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import java.io.IOException;
import java.io.Reader;
import java.util.ArrayList;
import java.util.List;

public class jb
{
  private j.a_ a;
  public static boolean b;
  
  public jb()
  {
    this(null);
  }
  
  public jb(j.a_ parama_)
  {
    a(parama_);
  }
  
  public void a(Reader paramReader)
    throws IOException
  {
    InputSource localInputSource = new InputSource(paramReader);
    a(localInputSource);
  }
  
  public void a(InputSource paramInputSource)
    throws IOException
  {
    try
    {
      SAXParserFactory localSAXParserFactory = SAXParserFactory.newInstance();
      localSAXParserFactory.setValidating(false);
      SAXParser localSAXParser = localSAXParserFactory.newSAXParser();
      XMLReader localXMLReader = localSAXParser.getXMLReader();
      a_ locala_ = new a_(this.a);
      localXMLReader.setContentHandler(locala_);
      localXMLReader.parse(paramInputSource);
    }
    catch (ParserConfigurationException localParserConfigurationException)
    {
      n.a(localParserConfigurationException);
      throw new IOException("Could not initialize XML Parser: " + localParserConfigurationException.getMessage());
    }
    catch (SAXException localSAXException)
    {
      n.a(localSAXException);
      throw new IOException("An error occured during the parsing: " + localSAXException.getMessage());
    }
  }
  
  public j.a_ a()
  {
    return this.a;
  }
  
  public void a(j.a_ parama_)
  {
    this.a = parama_;
  }
  
  static final class a_
    implements ContentHandler
  {
    private static final int a = 1;
    private static final int b = 2;
    private static final int c = 3;
    private String d;
    private int e;
    private StringBuffer f;
    private int h;
    private j.a_ i;
    private List j = new ArrayList();
    
    public a_(j.a_ parama_)
    {
      this.i = parama_;
      this.f = new StringBuffer(1024);
    }
    
    public void characters(char[] paramArrayOfChar, int paramInt1, int paramInt2)
      throws SAXException
    {
      this.f.append(paramArrayOfChar, paramInt1, paramInt2);
    }
    
    public void endDocument()
      throws SAXException
    {
      this.e = 0;
    }
    
    public void endElement(String paramString1, String paramString2, String paramString3)
      throws SAXException
    {
      boolean bool = r.f;
      if (!bool) {
        if ("section".equals(paramString3))
        {
          String str = (String)this.j.remove(this.j.size() - 1);
          if (!bool)
          {
            if (this.j.size() <= 0) {
              return;
            }
            this.i.b(str);
          }
          if ((!bool) && (r.e == 0)) {
            return;
          }
        }
      }
      if (!bool)
      {
        if (!"attribute".equals(paramString3)) {
          return;
        }
        if (bool) {
          break label158;
        }
      }
      switch (this.h)
      {
      case 1: 
        try
        {
          this.i.a(this.d, this.f.toString());
        }
        finally
        {
          this.d = null;
          this.f.setLength(0);
        }
      case 2: 
        try
        {
          this.i.a(this.d, new Double(this.f.toString()));
        }
        catch (NumberFormatException localNumberFormatException1)
        {
          this.i.a(this.d, new Double(0.0D));
        }
        finally
        {
          this.d = null;
          this.f.setLength(0);
        }
      case 3: 
        try
        {
          label158:
          this.i.a(this.d, new Integer(this.f.toString()));
        }
        catch (NumberFormatException localNumberFormatException2)
        {
          this.i.a(this.d, new Integer(0));
        }
        finally
        {
          this.d = null;
          this.f.setLength(0);
        }
      }
    }
    
    public void endPrefixMapping(String paramString)
      throws SAXException
    {}
    
    public void ignorableWhitespace(char[] paramArrayOfChar, int paramInt1, int paramInt2)
      throws SAXException
    {}
    
    public void processingInstruction(String paramString1, String paramString2)
      throws SAXException
    {}
    
    public void setDocumentLocator(Locator paramLocator) {}
    
    public void skippedEntity(String paramString)
      throws SAXException
    {}
    
    public void startDocument()
      throws SAXException
    {
      this.e = 1;
    }
    
    public void startElement(String paramString1, String paramString2, String paramString3, Attributes paramAttributes)
      throws SAXException
    {
      boolean bool = r.f;
      int k = r.e;
      String str;
      if (!bool) {
        if ("section".equals(paramString3))
        {
          str = paramAttributes.getValue("name");
          this.j.add(str);
          this.f.setLength(0);
          if (!bool)
          {
            if (this.j.size() <= 1) {
              return;
            }
            this.i.a(str);
          }
          if (!bool) {
            if (k == 0) {
              return;
            }
          }
        }
        else
        {
          if (bool) {
            break label130;
          }
        }
      }
      if ("attribute".equals(paramString3))
      {
        this.d = paramAttributes.getValue("key");
        label130:
        str = paramAttributes.getValue("type");
        this.f.setLength(0);
        if (!bool) {
          if ("double".equals(str))
          {
            this.h = 2;
            if ((!bool) && (k == 0)) {
              return;
            }
          }
        }
        if (!bool) {
          if ("int".equals(str))
          {
            this.h = 3;
            if (!bool) {
              if (k == 0) {
                return;
              }
            }
          }
          else
          {
            this.h = 1;
          }
        }
        if (k == 0) {}
      }
      else
      {
        throw new RuntimeException("Unexpected element " + paramString3);
      }
    }
    
    public void startPrefixMapping(String paramString1, String paramString2)
      throws SAXException
    {}
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.e.a.jb

 * JD-Core Version:    0.7.0.1

 */